package com.example.testgit.mapstruct;


import com.example.testgit.VO.ActivityVO;
import com.example.testgit.entity.ActivityDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface ActivityConverter {
    ActivityConverter INSTANCE = Mappers.getMapper(ActivityConverter.class);

    @Mappings({
            @Mapping(source = "activityTime", target = "activityTime", dateFormat = "yyyy年MM月dd日")
    })
    ActivityVO toVO(ActivityDO activityDO);

    @Mappings({
            @Mapping(source = "activityTime", target = "activityTime", dateFormat = "yyyy年MM月dd日")
    })
    List<ActivityVO> toVOList(List<ActivityDO> activityDOList);
}
